Skip to content

Make retry delays respect the original timeout budget#628

Merged
ryanfowler merged 1 commit into
mainfrom
fix-retry-timeout-budget
May 27, 2026
Merged

Make retry delays respect the original timeout budget#628
ryanfowler merged 1 commit into
mainfrom
fix-retry-timeout-budget

Conversation

@ryanfowler
Copy link
Copy Markdown
Owner

Summary

  • Keep the original --timeout deadline across all retry attempts.
  • Cap retry sleeps to the remaining budget and fail before the next attempt when the budget is exhausted.
  • Refresh the per-request reqwest timeout before every send so retries inherit the current remaining time.
  • Add a best-effort time cap to response draining on retry paths.
  • Add integration coverage for timeout exhaustion on both retryable status responses and retryable transport errors.

Testing

  • cargo fmt
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --all-features --test integration -- --test-threads=1
  • cargo test --all-features --bin fetch

@ryanfowler ryanfowler enabled auto-merge May 27, 2026 19:49
@ryanfowler ryanfowler force-pushed the fix-retry-timeout-budget branch from 4546272 to 1466789 Compare May 27, 2026 20:54
@ryanfowler ryanfowler merged commit ecb1dad into main May 27, 2026
4 checks passed
@ryanfowler ryanfowler deleted the fix-retry-timeout-budget branch May 27, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant